#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QSqlDriver>
#include <QSqlDatabase>
#include <QAxObject>
#include <QDir>
#include <QMessageBox>
#include <QtDebug>
#include <QSqlQuery>
#include <QFile>
#include <QTextStream>
#include <QMouseEvent>


QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();


private:
    Ui::Widget *ui;
    QSqlDatabase sql;
    QAxObject *m_pExcel;
    QAxObject *m_pWorkBooks;
    QAxObject *m_pWorkBook;
    QAxObject *m_pWorkSheets;
    QAxObject *m_pWorkSheet;

    QPoint windowPos;
    QPoint mousePos;
    QPoint dPos;
    void AddNewExcel();
    void SaveAndClose();
    void SetCell(int row, int column, QString value);
    void SetCell(QString number, QString value);
    QString get_String(int row, int col);

signals:
    void show_doc();
    void show_child_info();
    void show_setting();
    void show_data();


private slots:
    /*
     *  软件说明函数
     */
    void soft_doc();
    void child_info();
    void pushout_excel();
    void click_close();
    void click_setting();
    void click_data();
    void click_min();
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
//    void paintEvent(QPaintEvent* event);
};
#endif // WIDGET_H
